package com.link2room.rodimus.controller.inside;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.rodimus.dto.param.inside.CouponGiveOutInsideParamDto;
import com.link2room.rodimus.facade.IAfterPMSdepDoFacadeService;
import com.link2room.rodimus.facade.ICouponFacadeService;
import com.link2room.soundwave.dto.param.inside.PmsReservationInsideParamDto;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by LN on 2017/10/25
 */
@Api(tags = "联房券相关")
@RestController
@RequestMapping("/in/Coupons")
public class CouponInsideController {
    @Resource(name = "couponFacadeService")
    private IAfterPMSdepDoFacadeService afterPMSdepDoFacadeService;

    @Resource(name = "couponFacadeService")
    private ICouponFacadeService couponFacadeService;

    @RequestMapping("/afterDepSend")
    public BaseResultDto afterDepSend(@RequestBody PmsReservationInsideParamDto pmsReservationInsideParamDto) throws Exception {
        afterPMSdepDoFacadeService.syncAfterPMSDepDo(pmsReservationInsideParamDto);
        BaseResultDto resDto = new BaseResultDto();
        resDto.setResultCode(0);
        return resDto;
    }
    @RequestMapping(path = "/putOutCoupon",method = RequestMethod.POST)
    public BaseResultDto putOutCoupon(@RequestBody CouponGiveOutInsideParamDto paramDto) throws Exception {
        couponFacadeService.putOutCoupon(paramDto);
        BaseResultDto resDto = new BaseResultDto();
        resDto.setResultCode(0);
        return resDto;
    }



}
